import java.util.Scanner;
import java.util.Date;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class TaskMaster {

	private static TextUI ui;
	//private static TaskDirector director;
	//private static TaskMemoryController mem_controller;
	
	public static void main(String[] args) {
		ui = new TextUI();
		ui.readInput();
	}

}

class TextUI {
	Scanner sc;
	public TextUI(){
		sc = new Scanner(System.in);
		System.out.println("Welcome to Task Master!");
      //try
	}
	
	public void readInput(){
		while(true){
			String nl = sc.nextLine();
			String feedback = processCommand(nl);
			System.out.println(feedback);
		}
	}
	
	private String processCommand(String command){
		String feedback;
		if(command.contains("add")){
			Task new_task = addTask();
			feedback = new_task.title;
		} else {
			feedback = command;
		}
		
		return feedback;
	}
	
	private Task addTask(){
		Task temp = new Task();
		System.out.println("Create New Task. Please insert title:");
		temp.title = sc.nextLine();
		System.out.println("Please insert Deadline:");
		//temp.date = 
		System.out.println("Please insert desc:");
		temp.desc = sc.nextLine();
		return temp;
	}
  private void searchTask(){
     
   }
  private task edit task(){
    trask temp=new task();
    return temp;  
    }
  private string deleteTask(){
    string message=new string();
    return message;
    }
    
    public static Date convertDateStringToDateObj(String dateString){
		// online help: http://techtracer.com/2007/03/28/convert-date-to-string-and-string-to-date-in-java/
		
		SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); //can change the format if necessary
		Date _date = null;
		try {
			_date = formatter.parse(dateString);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return _date;
	}
	
}

class TaskDirector {
	
	
}

class TaskMemoryController {
	
	
}


class Task{
	int id;
	String title;
	Date deadline; //support for Date type
	String desc;
	String status = "INCOMPLETE"; //enum
  enum TASK_STATUS {COMPLETE, INCOMPLETE, LATE, REPEATED};
	//Tags
	//priority
	//repeated
	//creator
	
	public Task(){
		id=0;
		title="";
		//deadline = 
	}
	public Task(String tmp_title, Date tmp_date, String desc){
		//...
	}

}
